package com.bwie.api;

import com.bwie.bo.SpuBo;

import com.bwie.pojo.SpuDetail;
import com.bwie.utils.PageResult;
import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


import java.util.List;

@RequestMapping("/item/spu")
public interface GoodsApi {

    /**
     * 分页查询商品
     * @param page
     * @param rows
     * @param key
     * @param saleable
     * @return
     */
    @GetMapping("/page")
    PageResult<SpuBo> findSpuList(
            @RequestParam(value = "page", defaultValue = "1") Integer page,
            @RequestParam(value = "rows", defaultValue = "5") Integer rows,
            @RequestParam(value = "key",required = false) String key,
            @RequestParam(value = "saleable",required = false) Boolean saleable
    );


    /**
     * 根据商品spuId查询商品详情表的信息
     * @param spuId
     * @return
     */
    @GetMapping("/detail/{spuId}")
    SpuDetail getSpuDetail(@PathVariable("spuId") Long spuId) ;





}
